package com.xyg.pojo;

import com.xyg.auth.Role;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Document( "users" )
public class User {

    @Id
    private String id;
    @Indexed( unique = true )
    @Field( "username" )
    private String username;
    @Field( "password" )
    private String password;
    @Field( "email" )
    private String email;
    @Field( "role" )
    private Role role;

}
